home *** CD-ROM | disk | FTP | other *** search
/ Aminet 51 / Aminet 51 (2002)(GTI - Schatztruhe)[!][Oct 2002].iso / Aminet / dev / gcc / x86-ami-bin.readme < prev    next >
Encoding:
Text File  |  2002-07-25  |  5.2 KB  |  188 lines

  1. Short:    Binutils v2.9.1 - Amithlon x86 binutils (68k hosted)
  2. Author:   Jens.Langner@light-speed.de (Jens Langner)
  3. Uploader: Jens.Langner@light-speed.de (Jens Langner)
  4. Version:  2.9.1
  5. Type:     dev/gcc
  6. Requires: dev/gcc/x86-ami-gcc.lha
  7.  
  8. About
  9. -----
  10. This archive contains the binutils 2.9.1 version of the AmigaOS (68k)
  11. hosted binutils for compiling/porting existing applications to
  12. Amithlon (x86).
  13.  
  14. By installing this cross binutils, one will be able to
  15. easily port existing AmigaOS application to the new x86 hosted
  16. Amithlon emulation (www.amithlon.net) together with the cross-compiler
  17. also published as x86-ami-gcc.lha on Aminet.
  18.  
  19. This version is based on the 2.9.1 version of the binutils with changes
  20. mainly made by Martin Blom <martin@blom.org>.
  21. http://www.lysator.liu.se/~lcs/files/gg-cross
  22.  
  23. Please note that you also need the x86-ami-gcc.lha archive to
  24. successfully use the cross-binutils together with the gcc compiler.
  25.  
  26. Jens Langner <Jens.Langner@light-speed.de>
  27. July 2002
  28.  
  29. Documentation
  30. -------------
  31.  
  32. Setting up a i686be-amithlon cross compiler under AmigaOS
  33. ---------------------------------------------------------
  34.  
  35. 1) If you don't have a GeekGadget environment:
  36.  
  37. Make a GeekGadget directory somewhere, and assign GG: to it.
  38.  
  39.    1> makedir some_volume:GeekGadgets
  40.    1> assign GG: some_volume:GeekGadgets
  41.  
  42. Make a GG:bin directory, and add it to your path, or add it to
  43. your c: assign.
  44.  
  45.    1> makedir GG:bin
  46.    1> path GG:bin add
  47.  
  48.  
  49. 2) Unarchive the "x86-ami-bin.lha" and "x86-ami-gcc.lha" in GG:
  50.  
  51.    1> cd GG:
  52.    1> lha x  some_dir/x86-ami-bin.lha
  53.    1> lha x  some_dir/x86-ami-gcc.lha
  54.  
  55.  Warning 1:
  56.  ----------
  57. If you are unarchiving on a filesystem that doesn't support
  58. hard-links (e.g. SFS), you will have error messages and will
  59. need to make the links by hand (or replace them with copies).
  60. You need to have:
  61.   gg:i686be-amithlon/bin/as     ->  gg:bin/i686be-amithlon-as
  62.   gg:i686be-amithlon/bin/ar     ->  gg:bin/i686be-amithlon-ar
  63.   gg:i686be-amithlon/bin/ld     ->  gg:bin/i686be-amithlon-ld
  64.   gg:i686be-amithlon/bin/nm     ->  gg:bin/i686be-amithlon-nm
  65.   gg:i686be-amithlon/bin/ranlib ->  gg:bin/i686be-amithlon-ranlib
  66.   gg:i686be-amithlon/bin/strip  ->  gg:bin/i686be-amithlon-strip
  67.  
  68. where "->" means "link to" or "copy of".
  69.  
  70.  Warning 2:
  71.  ----------
  72. If using soft links, you have to specify the full path of the
  73. destination, not just a relative one.
  74.  
  75.  Warning 3:
  76.  ----------
  77. If using soft links under SFS, you need at least SFS version 1.62.
  78.  
  79.  
  80. 3) Copy the contents of the amithlon gcc includes to
  81.    GG:i686be-amithlon/sys-include
  82.  
  83.     1> copy somepath/includeamithlon GG:i686be-amithlon/sys-include all
  84.  
  85.  
  86. 4) Copy the lib directory from the amithlon lib archive to
  87.    GG:i686be-amithlon/lib and GG:i686be-amithlon/lib/libnix
  88.  
  89.     1> copy somepath/lib/libamigastubs.a GG:i686be-amithlon/lib
  90.  
  91.     1> copy somepath/lib/libnix GG:i686be-amithlon/lib ALL
  92.  
  93.   you can get those files from
  94.   http://www.lysator.liu.se/~lcs/files/gg-cross
  95.  
  96.  
  97.     Usage
  98.     -----
  99.  
  100. Currently, as there is no ixemul part for this amithlon gcc compiler,
  101. you always have to specify -noixemul for compiling something.
  102.  
  103. To compile 'hello.c' to 'hello' using libnix:
  104.  
  105.    1> i686be-amithlon-gcc -noixemul -o hello hello.c
  106.  
  107. To strip debugging informations and symbols from an executable file:
  108.  
  109.    1> i686be-amithlon-strip hello
  110.  
  111. To compile and link separately:
  112.  
  113.    1> i686be-amithlon-gcc -noixemul -c hello1.c
  114.    1> i686be-amithlon-gcc -noixemul -c hello2.c
  115.    1> i686be-amithlon-gcc -noixemul -r -o hello hello1.o hello2.o
  116.  
  117. (the last step can be replaced by a direct call to i686be-amithlon-ld)
  118.  
  119. Please note that your have to use the "-r" option for the moment like
  120. in former PowerUP days, as the linker isn`t fully working yet without
  121. it.
  122.  
  123. * Some useful options:
  124.  
  125.    -O, -O2, -O3 to optimize (-O3 make files bigger, be careful)
  126.  
  127.    -mcpu=i386, -mcpu=i486, -mcpu=pentium, -mcpu=k6 to optimize for a
  128.    specific cpu. Files optimized for one processor still work on others.
  129.  
  130.    -v to view the exact commands executed by gcc, and its include
  131. search path. Useful to find out installation problems.
  132.  
  133.  
  134. * Predefined symbols:
  135.  
  136. __ELF__, __pentiumpro__, __amithlon__
  137.  
  138. __i386__ if compiled with -mcpu=i386
  139. __i486__ if compiled with -mcpu=i486
  140. __i586__ if compiled with -mcpu=i586 or -mcpu=k6
  141. __i686__ if compiled without -mcpu= or -mcpu=pentiumpro
  142.  
  143. __amigaos__, amigaos, amiga, AMIGA, MCH_AMIGA for compatibility
  144.  
  145.  
  146. * Some remarks:
  147.  
  148. 1) This compiler uses the natural alignment, i.e. in
  149.    struct S
  150.    {
  151.      short a;
  152.      long b;
  153.    };
  154.  
  155. the offset of 'b' is 4, and not 2 as with 68k compilers. You can
  156. force the alignment to be 2 by defining S as follow:
  157.  
  158.   struct S
  159.   {
  160.     short a;
  161.     long b __attribute__((aligned(2)));
  162.   } __attribute__((packed));
  163.  
  164. or even better by:
  165.  
  166.   #pragma pack(2)
  167.    struct S
  168.    {
  169.      short a;
  170.      long b;
  171.    };
  172.   #pragma pack()
  173.  
  174. Usually you shouldn't care about that, except in interfaces with
  175. external libraries, or for binary compatibility if you read/write
  176. such structures from/to files.
  177.  
  178. Attn: floats and doubles must _never_ have an alignment lower than 4.
  179.  
  180. 2) The diff file on which this release was build can be found at:
  181.    http://www.lysator.liu.se/~lcs/files/gg-cross
  182.  
  183. Have phun
  184. and keep up the good work
  185.  
  186. Jens Langner <Jens.Langner@light-speed.de>
  187. July 2002
  188.